// To parse this JSON data, do
//
//     final jetourDetailModel = jetourDetailModelFromJson(jsonString);

import 'dart:convert';

JetourDetailModel jetourDetailModelFromJson(String str) => JetourDetailModel.fromJson(json.decode(str));

String jetourDetailModelToJson(JetourDetailModel data) => json.encode(data.toJson());

class JetourDetailModel {
  String caption;
  int? cate;
  String description;
  List<dynamic> images;
  List<String>? tags;
  List<NodeList> nodeList;
  List<Videos> videos;

  JetourDetailModel({
    required this.caption,
    required this.description,
    required this.images,
    required this.nodeList,
    required this.videos,
     this.cate,
     this.tags,

  });

  factory JetourDetailModel.fromJson(Map<String, dynamic> json) => JetourDetailModel(
    caption: json["caption"],
    cate: json["cate"],
    description: json["description"],
    images: List<dynamic>.from(json["images"].map((x) => x)),
    tags: json["tags"]== null?[]: List<String>.from(json["tags"].map((x) => x)),
    nodeList: List<NodeList>.from(json["nodeList"].map((x) => NodeList.fromJson(x))),
    videos: List<Videos>.from(json["videos"].map((x) => Videos.fromJson(x))),
  );

  Map<String, dynamic> toJson() => {
    "caption": caption,
    "cate": cate,
    "description": description,
    "images": List<dynamic>.from(images.map((x) => x)),
    "tags": List<dynamic>.from(tags!.map((x) => x)),
    "nodeList": List<dynamic>.from(nodeList.map((x) => x.toJson())),
  };
}
class Videos {
  String url;
  String frame;
  Videos({
    required this.url,
    required this.frame,
  });

  factory Videos.fromJson(Map<String, dynamic> json) => Videos(
    url: json["url"],
    frame: json["frame"],
  );

  Map<String, dynamic> toJson() => {
    "url": url,
    "frame": frame,
  };
}
class NodeList {
  int dayId;
  String startCity;
  String endCity;
  int distance;
  String distanceText;
  List<Node> node;

  NodeList({
    required this.dayId,
    required this.startCity,
    required this.endCity,
    required this.distance,
    required this.distanceText,
    required this.node,
  });

  factory NodeList.fromJson(Map<String, dynamic> json) => NodeList(
    dayId: json["dayId"],
    startCity: json["startCity"],
    endCity: json["endCity"],
    distance: json["distance"],
    distanceText: json["distanceText"],
    node: List<Node>.from(json["node"].map((x) => Node.fromJson(x))),
  );

  Map<String, dynamic> toJson() => {
    "dayId": dayId,
    "startCity": startCity,
    "endCity": endCity,
    "distance": distance,
    "distanceText": distanceText,
    "node": List<dynamic>.from(node.map((x) => x.toJson())),
  };
}

class Node {
  int nodeId;
  String caption;
  String logo;
  List<String> images;
  String provinceName;
  String cityName;
  String address;
  double lng;
  double lat;
  int distance;
  String description;
  Node({
    required this.nodeId,
    required this.caption,
    required this.logo,
    required this.images,
    required this.provinceName,
    required this.cityName,
    required this.address,
    required this.lng,
    required this.lat,
    required this.distance,
    required this.description,
  });

  factory Node.fromJson(Map<String, dynamic> json) => Node(
    nodeId: json["nodeId"],
    caption: json["caption"],
    logo: json["logo"],
    images: List<String>.from(json["images"].map((x) => x)),
    provinceName: json["provinceName"],
    cityName: json["cityName"],
    address: json["address"],
    lng: json["lng"]?.toDouble(),
    lat: json["lat"]?.toDouble(),
    distance: json["distance"],
    description: json["description"] == null?'': json["description"],
  );

  Map<String, dynamic> toJson() => {
    "nodeId": nodeId,
    "caption": caption,
    "logo": logo,
    "images": List<dynamic>.from(images.map((x) => x)),
    "provinceName": provinceName,
    "cityName": cityName,
    "address": address,
    "lng": lng,
    "lat": lat,
    "distance": distance,
    "description": description,
  };
}
